package com.hundsun.yr.universal.p2p.bean.enums;

import java.util.ArrayList;
import java.util.HashMap;

import com.hundsun.yr.universal.p2p.bean.UserPersonalInfo;
import com.hundsun.yr.universal.p2p.bean.enums.base.Enum;
import com.hundsun.yr.universal.p2p.bean.enums.base.LabelEnum;

public class MarryStatusEnum extends LabelEnum {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public static MarryStatusEnum MARRIED = new MarryStatusEnum("MARRIED", "已婚");
	public static MarryStatusEnum UNMARRIED = new MarryStatusEnum("UNMARRIED", "未婚");
	public static MarryStatusEnum DISSOCIATION = new MarryStatusEnum("DISSOCIATION", "离异");

	private static HashMap<String, String> mHashMap = new HashMap<String, String>();

	protected MarryStatusEnum(String name, String lable) {
		super(name, lable, UserPersonalInfo.MARRYSTATE);
		title = "婚姻";
	}

	public static ArrayList<LabelEnum> getList() {
		mList.clear();
		mList.addAll(Enum.getEnumList(MarryStatusEnum.class));
		return mList;
	}

	public static HashMap<String, String> getHashMap() {
		if (mHashMap == null || mHashMap.size() == 0) { // 保证mHashMap只进行一次赋值，只遍历一次mList
			ArrayList<LabelEnum> list = getList();
			for (LabelEnum labelEnum : list) {
				mHashMap.put(labelEnum.getName(), labelEnum.getLable());
			}
		}
		return mHashMap;
	}
}
